package com.freewater.library.common.infrastructure.event;

import com.freewater.library.common.domain.DomainEvent;
import lombok.RequiredArgsConstructor;
import org.springframework.context.ApplicationEventPublisher;

@RequiredArgsConstructor
public class SyncDomainEventDispatcher implements DomainEventDispatcher {

    private final ApplicationEventPublisher applicationEventPublisher;

    @Override
    public void dispatch(DomainEvent event) {
        this.applicationEventPublisher.publishEvent(event);
    }
}
